package com.shoulder.authorizationserver.rsa;

import com.shoulder.authorizationserver.enhancer.JwtTokenEnhancer;
import org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext;
import org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer;

public class RsaKeyPairJWKTokenCustomizer implements OAuth2TokenCustomizer<JwtEncodingContext> {

    private final JwtTokenEnhancer jwtTokenEnhancer;

    public RsaKeyPairJWKTokenCustomizer(JwtTokenEnhancer jwtTokenEnhancer) {
        this.jwtTokenEnhancer = jwtTokenEnhancer;
    }

    @Override
    public void customize(JwtEncodingContext context) {
        jwtTokenEnhancer.enhance(context);
    }
}

